package com.light.gulimall.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.light.common.utils.PageUtils;
import com.light.common.utils.R;
import com.light.gulimall.member.dto.LoginDTO;
import com.light.gulimall.member.dto.SocialUser;
import com.light.gulimall.member.entity.MemberEntity;
import com.light.gulimall.member.exception.PhoneExeception;
import com.light.gulimall.member.exception.UserNameException;
import com.light.gulimall.member.vo.UserRegisterVo;

import java.util.Map;

/**
 * 会员
 *
 * @author minmin
 * @email 980680541@gmail.com
 * @date 2024-07-16 21:23:05
 */
public interface MemberService extends IService<MemberEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 用户注册
     * @param vo 注册信息
     * @return 返回结果
     */
    R userRegister(UserRegisterVo vo) throws UserNameException, PhoneExeception;


    void checkUserNameAndPhone(UserRegisterVo vo)throws PhoneExeception, UserNameException;

    /**
     * 登录
     * @param dto   登录信息
     * @return  成功则返回登录实体类
     */
    R login(LoginDTO dto);

    /**
     * 社交登录
     * @param dto 第三方登录返回信息类
     * @return  成功则返回登录实体类
     */
    R login(SocialUser dto);
}

